# #print(3/0)
# try:#捕获异常
#     print(3/0)
# except:#异常的类型
#     print('除数不能为0')
# #不会报错的报错
# else:#不报错的情况下执行
#     print('未发生异常')
# finally:#没有异常时，执行
#     print('不管怎么样我都会执行')
import random as r
nums = []
for i in range(0,50):
    nums.append(i)
print(nums)
num = int(input('请输入抽检数量：'))#抽多少次
def checkzero(num):
    li = []#抽检出来的空列表
    for x in range(num):
        a = r.randint(0, len(nums)-1)
        a = nums[a]
        if a not in li:
            li.append(a)
            nums.remove(a)
    try:
        for i in li:
            j = 1/i
    except:
        print('发现0')
    else:
        print('一切正常')
    finally:
        print('抽检详情：',li)

checkzero(num)  




